#ifndef __USART2_H
#define __USART2_H

#include "sys.h"


#define USART_RX_MAX_LEN 128

typedef struct {
    uint8_t data[USART_RX_MAX_LEN];
    uint8_t new_data;
    uint8_t timeout;
    uint8_t RX_cnt;
    struct {
        uint16_t len: 15;
        uint16_t sta: 1;
    } result;

}USART_REV_t;

//extern USART_REV_t USART2_REV;



void USART2_Init(uint32_t bound);

void usart2_task(void);
void USART2_Tx(uint8_t* pData, uint16_t len);

void reply_cmd_Handshake(void);

#endif
